/*
 * Matrix3.h
 *
 *  Created on: 2012/07/04
 *      Author: weihe
 */

#ifndef MATRIX3_H_
#define MATRIX3_H_

#include <cstring>
#include "Vector4.h"

namespace geom {

class Matrix3 {
protected:
	float raw[9];
public:
	Matrix3() {
	}
	Matrix3(float *data) {
		memcpy(raw, data, sizeof(raw));
	}
	float& m(int i, int j) {
		return raw[3 * i + j];
	}

	template<class T>
	Vector4<T> operator*(Vector4<T> v);
};

class RotateMatrix: public Matrix3 {
	void rotateX(float rad);
	void rotateY(float rad);
	void rotateZ(float rad);
	void rotateAngle(float rad, Vector4f axis);
public:
	RotateMatrix(float angle, Vector4f axis);
};

} /* namespace geom */

#endif /* MATRIX3_H_ */
